<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html class="login-html">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <link rel="shortcut icon" href="./content/images/fav.ico" type="image/x-icon">
    <link href="content/css/reset.css" rel="stylesheet" type="text/css"/>
    <link href="content/css/login.css" rel="stylesheet" type="text/css"/>
    <title>云总线（CANCloud）</title>
    <!-- jQuery -->
    <script src="content/js/lib/jquery.min.js"></script>
    <script type="text/javascript" src="content/js/widgets/slide.js"></script>

    <!--[if lt IE 9]>
    <script src="content/js/lib/html5shiv.min.js"></script>
    <![endif]-->

</head>

<body class="login-body" id="top">
<header class="top-bar top-bar-active">
    <div class="inner-box clearfix">
        <img src="<c:url value="/content/images/login-logo_06.png"/>" border="0" alt="">
        <nav>
            <!--<a class="nav-login-btn" href="#top"  target="_self">登录</a>-->
            <ul>
                <!--<li><a class="btn-tese" >功能特色</a></li>
                <li><a class="btn-huoban" >合作伙伴</a></li>
                <li><a href="#shengqing" target="_self">申请试用</a></li>-->
                <li><a href="<c:url value='/common/appDownloadIndex.htm' />" target="_blank">App下载</a></li>
                <li id="toPlat1_0" style="display: none;"><a href="http://v1.hnsyun.com/can/login.jsp"
                                                             target="_blank"><span class="iconhns">&#xe62a;</span>切换到旧版本</a>
                </li>
            </ul>
        </nav>
    </div>
</header>

<div class="banner-wrap">
    <div class="banner">
        <div id="slides" class="slides">
            <div class="slides_container">
                <span class="banner1"></span>
                <span class="banner2"></span>
                <span class="banner3"></span>
                <span class="banner4"></span>
            </div>
        </div>
    </div>
    <form id="login_form" class="form-horizontal" action="<c:url value='j_spring_security_check' />" method="post"
          autocomplete="off">
        <div class="inner-box">
            <div class="login-wrap">
                <h2>欢迎使用云总线</h2>

                <div class="input-wrap active">
                    <input type="text" placeholder="请您输入用户名" id="j_username" name="j_username">
                </div>
                <div class="input-wrap password">
                    <input type="password" placeholder="请您输入密码" id="j_password" name="j_password">
                </div>
                <a id="login_submitBtn" class="login-btn">登录</a>

                <div class="clearfix remenber">
                    <div class="fl">
                        <input type="checkbox"><span>记住密码</span>

                    </div>
                    <div class="fr">
                        <div class="app-download" id="ewm">App客户端下载
                            <img src="" width="264" height="168" border="0" alt="" id="ewmPic">
                        </div>
                        <%--<div class="app-download" id="ewm">App客户端下载
                            <img src="<c:url value="/content/images/login-ewm_11.png"/>" width="264" height="168"
                                 border="0" alt="">
                        </div>
                         <div class="app-download" id="sc_outer_ewm" style="display: none;">App客户端下载
                            <img src="<c:url value="/content/images/sc-login-ewm1.png"/>" width="264" height="168"
                                 border="0" alt="">
                        </div>
                        <div class="app-download" id="sc_inner_ewm" style="display: none;">App客户端下载
                            <img src="<c:url value="/content/images/sc-login-ewm2.png"/>" width="264" height="168"
                                 border="0" alt="">
                        </div> --%>
                    </div>
                </div>
                <p class="explore">建议使用IE8以上、360、谷歌、火狐浏览器</p>

                <%-- <c:if test="${not empty param.login_error}">
                	<c:choose>
	                	<c:when test="${'1' == param.login_error}">
	                		<div class="warning">
	                        		该账户已在其他地方登录
	                    	</div>
	                	</c:when>
	                	<c:when test="${'2' == param.login_error}">
		                	<div class="warning">
		                        	在线超时，请重新登录
		                    </div>
	                	</c:when>
	                	<c:otherwise>
		                    <div class="warning">
		                        	密码输入错误
		                    </div>
	                	</c:otherwise>
                	</c:choose>
                </c:if> --%>

                <c:if test="${not empty param.login_error}">
                    <div class="warning">
                        密码输入错误
                    </div>
                </c:if>

            </div>
        </div>
    </form>
</div>

<footer>© 2015厦门汉纳森软件科技有限公司 闽ICP备15013270号-1</footer>


<script type="text/javascript">
    $(function () {
        $('#slides').slides({
            preload: true,
            play: 4500,
            pause: 500,
            hoverPause: false
        });

        $('.slides_container span').css('width', document.documentElement.clientWidth || document.body.clientWidth);
        window.onresize = function () {
            $('.slides_container span').css('width', document.documentElement.clientWidth || document.body.clientWidth)
        };

        // 针对汉纳森平台，增加跳转到v1.0
        var host = window.location.host;
        if (host.indexOf("www.hnsyun.com") >= 0) {
            $('#toPlat1_0').show();
        } else {
            $('#toPlat1_0').hide();
        }
        
        //TODO
        /*var host = window.location.host;
        if (host.indexOf("183.237.185.68") >= 0 || host.indexOf("192.168.182.53") >= 0) {
            if (host.indexOf("183.237.185.68") >= 0) {
                $("#ewm").hide();
                $("#sc_inner_ewm").hide();
                $("#sc_outer_ewm").show();
            } else if (host.indexOf("192.168.182.53") >= 0) {
                $("#ewm").hide();
                $("#sc_outer_ewm").hide();
                $("#sc_inner_ewm").show();
            }
        }*/
        
        $.ajax({
            url: "logon/commonUrlInfo.htm",
            //url : url,
            dataType: "JSON",
            success: function (data) {
                if (host.indexOf(data.obj.innerIp) >= 0) {
                    $("#ewmPic").attr("src", data.obj.innerLoginEwm);
                } else {
                    console.info(data.obj.outerLoginEwm);
                    $("#ewmPic").attr("src", data.obj.outerLoginEwm);
                }
            }
        })/* .done(function(data){

         }) */;


        $(':text,:password').focus(function () {
            $(this).parent().addClass('active');
        }).blur(function () {
            $(this).parent().removeClass('active');
        });

        document.getElementById("j_username").focus();
        var $submitBtn = $('#login_submitBtn');
        $submitBtn.click(function () {
            var form = $('#login_form');
            form.submit();
        });

        $(document.body).keydown(function () {
            if (event.keyCode == 13) { //回车键的键值为13
                $submitBtn.trigger('click'); //调用登录按钮的登录事件
            }
        });

    });
</script>

</body>
</html>